#pragma once

// #include <afxtempl.h>
// CYJDriveBar

// typedef struct tag_DriveInfo{
// 	CString		m_csLetter;
// 	CString		m_csLabel;
// 	HICON		m_hIcon;
// 
// 	tag_DriveInfo(CString csLetter = _T(""), CString csLabel = _T(""), HICON hIcon = NULL):
// 		m_csLetter(csLetter),
// 		m_csLabel(csLabel),
// 		m_hIcon(hIcon)
// 	{};
// }DRIVE_INFO;
// 
// typedef CArray<DRIVE_INFO,DRIVE_INFO&> CDriveArray;

#define DRIVE_BUTTON_CLICKED	(WM_USER+100)

class CYJDriveBar : public CWnd
{
	DECLARE_DYNAMIC(CYJDriveBar)

private:
	CObArray			m_arrDriveButtons;
	COLORREF			m_clrBackground;
	HFONT				m_hFont;
	HWND				m_hNotifyWnd;
	int					m_nCheckIndex;

	void LoadDriveButtons();
	CString GetDriveLabel(LPCTSTR lpszDrive);
	HICON GetDriveIcon(LPCTSTR lpszDrive);
protected:
	DECLARE_MESSAGE_MAP()

public:
	CYJDriveBar();
	virtual ~CYJDriveBar();

	void SetBackgroundColor(COLORREF clrBackground, BOOL bRepaint = TRUE);
	void RemoveAll();
	void SetFont( CFont* pFont, BOOL bRedraw = TRUE );
	CFont* GetFont();
	void SetNotifyWnd(HWND hWnd);
	void SetDriveChecked(TCHAR chDriveLetter = _T('C'));
	void SetDriveChecked(int nIndex);

	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
	afx_msg virtual void OnDriveBtnClick(UINT nID);
protected:
	virtual LRESULT DefWindowProc(UINT message, WPARAM wParam, LPARAM lParam);
};


